﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace LynxBlogAPI.Models.Mapping
{
    public class BlogLayoutDataMap : EntityTypeConfiguration<BlogLayoutData>
    {
        public BlogLayoutDataMap()
        {
            this.HasKey(t => t.bloglayoutid);

            this.Property(t => t.bloglayoutid).HasColumnName("BlogLayoutId").HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            this.Property(t => t.username).HasColumnName("UserName").HasMaxLength(50).IsRequired();
            this.Property(t => t.blogname).HasColumnName("BlogName").HasMaxLength(100).IsRequired();
            this.Property(t => t.header_image).HasColumnName("HeaderImage").HasMaxLength(150);
            this.Property(t => t.color_primary).HasColumnName("ColorPrimary").HasMaxLength(7);
            this.Property(t => t.color_border).HasColumnName("ColorBorder").HasMaxLength(7);
            this.Property(t => t.color_background).HasColumnName("ColorBackground").HasMaxLength(7);
            this.Property(t => t.color_primary_dark).HasColumnName("ColorPrimaryDark").HasMaxLength(7);
            this.Property(t => t.color_border_dark).HasColumnName("ColorBorderDark").HasMaxLength(7);
            this.Property(t => t.category_display).HasColumnName("CategoryDisplay").IsRequired();
            this.Property(t => t.month_display).HasColumnName("MonthDisplay").IsRequired();
            this.Property(t => t.tagcloud_display).HasColumnName("TagcloudDisplay").IsRequired();
            this.Property(t => t.googlead_display).HasColumnName("GoogleAdDisplay").IsRequired();
            this.Property(t => t.custom_css).HasColumnName("CustomCss");
            this.ToTable("tblBlogLayout");
        }
    }
}